﻿@model BlackBox.Controllers.AccountViewModel
@{
    ViewBag.Title = "Group";
}

<div id="group-page">
    <p>
        <a href="~/Home/Main">Home</a>
         >
        <a href="~/Account/Profile?name=@User.Identity.Name">Profile</a>
         > 
        <a href="~/Account/AllGroups">All groups</a>
    </p>
    <h3>@Model.GroupData.name</h3>
    <h6>Group members</h6>
    <ul >
        @foreach( var user in Model.UserListData)
        {
            <li>
                <a href="~/Account/Profile?name=@user.UserName">
                    @user.UserName
                </a>
            </li>
        }
    </ul>

    <input type="button" onclick="window.location='/Account/JoinGroup/@Model.GroupData.id'" value="Join group" />
    <input type="button" onclick="window.location='/Account/LeaveGroup/@Model.GroupData.id'" value="Leave group" />

    <div>
        <input type="text" id="invite" name="@Model.GroupData.id" />
        <input type="button" id="send-invite" value="Invite" />
        <div id="invite-sent"></div>
    </div>

</div>

